home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / kcl / kcl.lha / doc / update < prev   
Text File  |  1986-07-11  |  15KB  |  516 lines

  1. KYOTO COMMON LISP UPDATE NOTICES
  2.  
  3. -----------------------
  4. Date: 86/5/17
  5. By: Taiichi
  6. Subject: Full online documentation
  7.  
  8. KCL is now equipped with online documentations for:
  9.  
  10.     all special forms
  11.     all built-in macros
  12.     all built-in functions
  13.     all built-in variables and constants
  14.     some built-in types
  15.     some useful system internal functions
  16.  
  17. -----------------------
  18. Date: 86/5/17
  19. By: Taiichi
  20. Subject: HELP and HELP* are added.
  21.  
  22. These functions print online documentations onto the display.
  23.  
  24. (HELP <symbol>) prints the documentation associated with <symbol>.
  25. (HELP) prints the greeting message to KCL beginners.
  26.  
  27. (HELP* <string> <package>) prints the documentation associated
  28. with those symbols in the specified <package> whose print names
  29. contain <string> as substring.  <string> may be a symbol, in which
  30. case the print-name of that symbol is used.  <package> is optional and
  31. defaults to the LISP package.  If <package> is NIL, then all packages
  32. are searched.
  33.  
  34. -----------------------
  35. Date: 86/5/17
  36. By: Taiichi
  37. Subject: COMPILE-FILE now accepts two additional keyword parameters.
  38.  
  39. If the value of the keyword parameter :LOAD is non-NIL, then COMPILE-FILE
  40. loads the generated fasl file after compilation.  :LOAD defaults to NIL.
  41.  
  42. If the value of the keyword parameter :MESSAGE-FILE is non-NIL, then
  43. compiler messages are logged into the file specified by this parameter.
  44. If the specified file already exists, then the messages are appended to the
  45. file.  If not, a new file is created.  :MESSAGE-FILE defaults to the value
  46. of the variable COMPILER:*DEFAULT-MESSAGE-FILE*.
  47.  
  48. -----------------------
  49. Date: 86/5/17
  50. By: Taiichi
  51. Subject: COMPILE now deletes GAZONK files by default.
  52.  
  53. If you want to save the intermediate GAZONK files, specify a non-NIL value
  54. as the keyword parameter :LEAVE-GAZONK to COMPILE.  In case you do not
  55. want to specify the optional parameter <definition> to COMPILE, specify
  56. NIL.  COMPILE now treats the NIL value as if <definition> was not specified.
  57. Thus, for example,
  58.  
  59.     (COMPILE 'FOO NIL :LEAVE-GAZONK T)
  60.  
  61. compiles the function definition associated with FOO and leaves the
  62. intermediate GAZONK files.
  63.  
  64. -----------------------
  65. Date: 86/5/17
  66. By: Taiichi
  67. Subject: LISTEN works in some versions.
  68.  
  69. Try with your KCL.
  70.  
  71. -----------------------
  72. Date: 86/5/17
  73. By: Taiichi
  74. Subject: The compiler does tail-recursion optimization.
  75.  
  76. By default, the compiler replaces tail-recursive calls with iteration.
  77. You will occasionally receive the following compiler message.
  78.  
  79.     ;; Note: Tail-recursive call of FOO was replaced by iteration.
  80.  
  81. There are two ways to prevent the compiler from doing this optimization.
  82.  
  83. 1. Set COMPILER::*DO-TAIL-RECURSION* to NIL.  No tail-recursion optimization
  84. is done while this variable has NIL value.  Note that this variable is
  85. associated to an internal symbol in the COMPILER package.
  86.  
  87. 2. Use NOT-INLINE declaration.  Tail-recursive calls of the functions declared
  88. NOT-INLINE are not replace with iterations.
  89.  
  90. Incidentally, the TAK example in Appendix B of KCL Report will get
  91. a better code:
  92.  
  93.     /*    local entry for function TAK    */
  94.  
  95.     static int LI1(V4,V5,V6)
  96.     int V4,V5,V6;
  97.     {    VMB3 VMS3 VMV3
  98.     TTL:;
  99.         if((V5)<(V4)){
  100.         goto T2;}
  101.         VMR3(V6)
  102.     T2:;
  103.         {int V7;
  104.         V7= LI1((V4)-1,V5,V6);
  105.         {int V8;
  106.         V8= LI1((V5)-1,V6,V4);
  107.         V6= LI1((V6)-1,V4,V5);
  108.         V5= V8;
  109.         V4= V7;}}
  110.         goto TTL;
  111.     }
  112.  
  113. which is equivalent to:
  114.  
  115.     /*    local entry for function TAK    */
  116.  
  117.     static int tak(x,y,z)
  118.     int x,y,z;
  119.     {
  120.     loop:    if(y<x) goto L;
  121.         return(z);
  122.     L:
  123.         {    int temp1=tak(x-1,y,z);
  124.             int temp2=tak(y-1,z,x);
  125.             z=tak(z-1,x,y);
  126.             y=temp2;
  127.             x=temp1;
  128.         }
  129.         goto loop;
  130.     }
  131.  
  132. -----------------------
  133. Date: 86/5/17
  134. By: Taiichi
  135. Subject: Now, the compiler always does error recovery.
  136.  
  137. Thanks Bob, I have never noticed that the old compiler sometimes fails
  138. to recover from compile-time errors.
  139.  
  140. -----------------------
  141. Date: 86/5/17
  142. By: Taiichi
  143. Subject: The pretty-printer became wiser.
  144.  
  145. The number N as the SI:PRETTY-PRINT-FORMAT property of a symbol <symbol>
  146. indicates that, in the form (<symbol> <f1> ... <fN> <fN+1> ... <fM>),
  147. the subforms <fN+1>,...,<fM> are the 'body' of the form and thus are
  148. treated in a special way by the KCL pretty-printer.
  149.  
  150. -----------------------
  151. Date: 86/5/17
  152. By: Taiichi
  153. Subject: Customizing the 'hole' size.
  154.  
  155. The size of the hole between the heap and relocatable area (see Section
  156. 4.2 of the KCL Report) highly affects the performance of memory management.
  157. With the smaller size of hole, then garbage collection occurs more frequently,
  158. but the total size of the (logical) memory used by KCL is kept smaller.
  159. We added the following functions so that the user can set up the
  160. 'appropriate size' of his own.
  161.  
  162. (SI:GET-HOLE-SIZE) returns as an integer the hole size (in pages).
  163. Note that this is NOT the size of the current hole, but IS the size
  164. of the hole immediately after each garbage collection.
  165.  
  166. (SI:SET-HOLE-SIZE <fixnum>) sets the hole size.  <fixnum> is the
  167. new size of the hole (in pages).  <fixnum> must be a positive fixnum.
  168.  
  169. To see how frequently the garbage collection occurs,
  170. set the variable SI:*GBC-MESSAGE* to a non-NIL value.
  171.  
  172. -----------------------
  173. Date: 86/5/20
  174. By: Taiichi
  175. Subject: Variable bindings in LET, LET*, and COMPILER-LET
  176.  
  177. According to CLtL, variable bindings in these special forms are given by
  178. the following syntax.
  179.  
  180.     ( { var | (var init) }* )
  181.  
  182. However, UME-san hates this and requested (or forced ?) us to extend the
  183. syntax so that <init> be optional.  Now, the syntax is:
  184.  
  185.     ( { var | (var [init]) }* )
  186.  
  187. -----------------------
  188. Date: 86/5/20
  189. By: Taiichi
  190. Subject: A symbol is accepted as a defmacro-lambda-list.
  191.  
  192. Again, UME-san requested us to make KCL accept a non-NIL symbol as a
  193. defmacro-lambda-list.  KCL now regards
  194.  
  195.     (DEFMACRO <name> <symbol> . <body> )
  196.  
  197. as equivalent to
  198.  
  199.     (DEFMACRO <name> (&REST <symbol>) . <body> )
  200.  
  201. -----------------------
  202. Date: 86/5/30
  203. By: Taiichi
  204. Subject: Character I/O
  205.  
  206. Now, PRIN1 prints some characters as
  207.  
  208.     #\\<octal digits>
  209.  
  210. This indicates that PRIN1 does not know a good representation for these
  211. characers.  For those KCL versions that use ASCII, those and only those
  212. characters whose codes are greater than 127 will be printed in this way.
  213.  
  214. In accordance, the KCL reader accepts inputs in this format.
  215.  
  216.     >(code-char #o200)
  217.     #\\200
  218.  
  219.     >(code-char #o100)
  220.     #\@
  221.  
  222.     >(char-code #\\200)
  223.     128
  224.  
  225.     >#\\100
  226.     #\@
  227.  
  228. -----------------------
  229. Date: 86/5/30
  230. By: Taiichi
  231. Subject: &BODY parameter to DEFMACRO
  232.  
  233. KCL now makes use of the pretty-printing information given by &BODY
  234. parameter to DEFMACRO.  Accordingly, &REST and &BODY are not equivalent
  235. any more.
  236.  
  237. For example, suppose we have defined a macro.
  238.  
  239.     (defmacro foo (x y &body z) ...)
  240.  
  241. Then, the form
  242.  
  243.     (foo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
  244.              bbbbbbbbbbbbbbbbbbbbbbbbbb
  245.              ccccccccccccccccccccc
  246.              dddddddddddddddd
  247.              eeeeeeeeeeeeeeeeeeeeeee)
  248.  
  249. will be pretty-printed as:
  250.  
  251.     (foo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbb
  252.       ccccccccccccccccccccc
  253.       dddddddddddddddd
  254.       eeeeeeeeeeeeeeeeeeeeeee)
  255.  
  256. But, if the macro definition uses &REST instead of &BODY, the same form
  257. will be prettey-printed as:
  258.  
  259.     (bar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbb
  260.          ccccccccccccccccccccc dddddddddddddddd eeeeeeeeeeeeeeeeeeeeeee)
  261.  
  262. -----------------------
  263. Date: 86/6/30
  264. By: Taiichi
  265. Subject: COMPILE-FILE accepts yet another keyword parameter.
  266.  
  267. If the value of the keyword parameter :VERBOSE is non-NIL, then COMPILE-FILE
  268. prints what functions, macros, etc. are being compiled.
  269.  
  270. -----------------------
  271. Date: 86/6/30
  272. By: Taiichi
  273. Subject: The stepper accepts more commands.
  274.  
  275. u    Goes to the enclosing form.
  276. r FORM    Evaluates the FORM and returns its value.
  277. b    Backtrace
  278.  
  279. -----------------------
  280. Date: 86/6/30
  281. By: Taiichi
  282. Subject: Note on SYSTEM
  283.  
  284. The function SYSTEM in KCL/Unix invokes sh rather than csh.
  285.  
  286. -----------------------
  287. Date: 86/6/30
  288. By: Taiichi
  289. Subject: COMPILE-FILE and COMPILE in KCL/VAX produces one more temporary file.
  290.  
  291. In KCL/VAX, COMPILE-FILE and COMPILE produces a temporary assembler file
  292. with the filetype ".s".  This file is automatically deleted after the
  293. compilation.  Unlike the other temporary files, the user cannot specify
  294. the assembler file by keyword parameters to COMPILE-FILE and COMPILE.
  295.  
  296. -----------------------
  297. Date: 86/6/30
  298. By: Taiichi
  299. Subject: Notifying GBC
  300.  
  301. There are C variables GBC_enter_hook and GBC_exit_hook, which hold
  302. the pointers to the functions to invoke respectively at the entry and
  303. at the exit of GBC.  By defining his own functions, and by setting
  304. these variables, the user can do whatever he wants.
  305.  
  306. Here is an example for you.
  307.  
  308.     % cat a.lsp
  309.  
  310.     (clines
  311.     "    /* Declare the global variables by yourself. */        "
  312.     "    int (* GBC_enter_hook) ();                "
  313.     "    int (* GBC_exit_hook) ();                "
  314.     "                                "
  315.     "    /* The C function to call on entry of GBC */    "
  316.     "    my_gbc_entry ()                        "
  317.     "    {                            "
  318.     "        printf(\"Sorry, I'm collecting garbages.\\n\");    "
  319.     "        fflush(stdout);                    "
  320.     "    }                            "
  321.     "                                "
  322.     "    /* The C function to call on exit from GBC */    "
  323.     "    my_gbc_exit ()                        "
  324.     "    {                            "
  325.     "        printf(\"Now, I continue your computation.\\n\");"
  326.     "        fflush(stdout);                    "
  327.     "    }                            "
  328.     "                                "
  329.     "    /* The C function to set the global variables */    "
  330.     "    initialize_my_gbc_message ()                "
  331.     "    {                            "
  332.     "        GBC_enter_hook = my_gbc_entry;            "
  333.     "        GBC_exit_hook = my_gbc_exit;            "
  334.     "    }                            ")
  335.  
  336.     (defentry initialize-my-gbc-message ()
  337.       "Sets the two C global variables."
  338.       (void "initialize_my_gbc_message"))
  339.     
  340.     % kcl
  341.     KCL (Kyoto Common Lisp)
  342.  
  343.     >(compile-file "a" :load t)
  344.     ...
  345.  
  346.     >(initialize-my-gbc-message)
  347.     nil
  348.  
  349.     >(dotimes (i 100) (make-list 1000))
  350.     Sorry, I'm collecting garbages.
  351.     Now, I continue your computation.
  352.     Sorry, I'm collecting garbages.
  353.     Now, I continue your computation.
  354.     Sorry, I'm collecting garbages.
  355.     Now, I continue your computation.
  356.     Sorry, I'm collecting garbages.
  357.     Now, I continue your computation.
  358.     nil
  359.  
  360.     >
  361.  
  362. -----------------------
  363. Date: 86/6/30
  364. By: Taiichi
  365. Subject: Yet another break-level command.
  366.  
  367. We added a break-level command :M (or :MESSAGE) which displays the
  368. error message.
  369.  
  370. -----------------------
  371. Date: 86/6/30
  372. By: Taiichi
  373. Subject: 
  374.  
  375. Now, there is no limit of the number of characters for strings being read.
  376.  
  377. -----------------------
  378. Date: 86/7/11
  379. By: Taiichi
  380. Subject: The break-level now rebinds *READTABLE*.
  381.  
  382. Now, the break-level rebinds *READTABLE* on its entry.  This is required
  383. when an KCL application clobbers the current readtable so much as to
  384. disable ordinary interaction within the break-level loop.  A variable
  385. SI:*BREAK-READTABLE* was added to control the binding.  If the value of
  386. this variable is NIL, then the break-level simply rebinds *READTABLE* to
  387. the current value of *READTABLE*.  Otherwise, *READTABLE* will be bound to
  388. the value of this variable.  Normally, the user, who wishes to use the
  389. standard readtable within the break-level loop, sets up this variable as:
  390.  
  391.     (SETQ SI:*BREAK-READTABLE* (COPY-READTABLE NIL))
  392.  
  393. before, of course, entering the break-level loop.  The initial value of
  394. SI:*BREAK-READTABLE* is NIL.
  395.  
  396. -----------------------
  397. Date: 86/7/11
  398. By: Taiichi
  399. Subject: Break-level Commands
  400.  
  401. The break-level has been revised for improvements.  Type :H at the
  402. break-level loop and see the facilities available now.
  403.  
  404. -----------------------
  405. Date: 86/7/11
  406. By: Taiichi
  407. Subject: (OPTIMIZE (SAFETY 3))
  408.  
  409. The declaration (OPTIMIZE (SAFETY 3)) now directs the compiler to generate
  410. code so that each function call from the compiled code opens a CATCH frame
  411. with the name of the called function as the catch tag.  Thus, at the
  412. break-level, the user can return any value(s) from any functions by
  413.  
  414.     (THROW <function-name> <value1> ... <valuen>)
  415.  
  416. -----------------------
  417. Date: 86/7/11
  418. By: Taiichi
  419. Subject: Compiler Macros
  420.  
  421.  
  422. SI:DEFINE-COMPILER-MACRO                    [MACRO]
  423.     <name> <lambda-list> {<decl> | <doc>}* <form>*
  424.  
  425. Similar to DEFMACRO.  However, SI:DEFINE-COMPILER-MACRO does not install the
  426. macro-expander function as the global macro definition of <name>.  Rather,
  427. it only directs the KCL compiler to expand a form (<name> ... ) only at
  428. compile time.  It never affects the function/macro cell of the symbol <name>,
  429. and ordinary function/macro definition (by DEFUN, DEFMACRO, etc.) does not
  430. affect the effect of SI:DEFINE-COMPILER-MACRO.  Further more, the doc-string
  431. <doc>, even if supplied, is just ignored, and &BODY in the <lambda-list> does
  432. not affect the pretty printer.
  433.      This macro is highly useful when porting Lisp applications written
  434. in Lisp dialects other than Common Lisp.  See the description of
  435. SI:DEFINE-INLINE-FUNCTION below.
  436.  
  437.  
  438. SI:UNDEF-COMPILER-MACRO <name>                    [FUNCTION]
  439.  
  440. Makes void the effect of (SI:DEFINE-COMPILER-MACRO <name> ... ).
  441. Note that this is a function but not a macro;  Its argument is evaluated.
  442.  
  443.  
  444. SI:DEFINE-INLINE-FUNCTION                    [MACRO]
  445.     <name> <lambda-list> {<decl> | <doc>}* <form>*
  446.  
  447. This macro roughly corresponds to the DEFSUBST macro in ZetaLisp.
  448.  
  449.     (SI:DEFINE-INLINE-FUNCTION <name> (<var-1> ... <var-l>)
  450.         <decl/doc-1> ... <decl/doc-m>
  451.       <form-1> ... <form-n> )
  452.  
  453. will be expanded into
  454.  
  455.     (PROGN
  456.       (DEFUN <name> (<var-1> ... <var-l>)
  457.           <decl/doc-1> ... <decl/doc-m>
  458.         <form-1> ... <form-n> )
  459.       (SI:DEFINE-COMPILER-MACRO <name> (<temp-1> ... <temp-l>)
  460.         `(LET ((<var-1> ,<temp-1>) ... (<var-n> ,<temp-n>))
  461.              <decl/doc-1> ... <decl/doc-m>
  462.            <form-1> ... <form-m> )))
  463.  
  464. Accordingly, there are some syntactic differences between
  465. SI:DEFINE-INLINE-FUNCTION forms and DEFUN forms.  Some of the differences
  466. are:
  467.  
  468.     1. The "lambda-list" should consist only of required variables.
  469.     2. The doc-string, if given, will be regarded as an ordinary string
  470.        by the compiler (because LET does not accept doc-strings).
  471.        As a result, declarations after the doc-string will cause a
  472.        compile-time error.
  473.     3. The compiled code does not establish a block named <name> around
  474.        the body.  Thus, the behaviour of (RETURN-FROM <name>) in the
  475.        compiled code might cause unexpected effects.
  476.  
  477.      As an example of the use of SI:DEFINE-INLINE-MACRO, let us define the
  478. function MEMQ.
  479.  
  480.     (SI:DEFINE-INLINE-FUNCTION MEMQ (X Y)
  481.       (MEMBER X Y :TEST #'EQ))
  482.  
  483. This form acutally defines MEMQ as a function.  Thus, for example,
  484.  
  485.     (FUNCALL #'MEMQ 'A '(A B C)) ==> (B C)
  486.  
  487.     (FBOUNDP 'MEMQ) ==> (LAMBDA-BLOCK MEMQ (X Y) (MEMBER X Y :TEST #'EQ))
  488.  
  489. On the other hand, the compiler expands the form
  490.  
  491.     (MEMQ (GIVE-ITEM) (GIVE-LIST))
  492.  
  493. into
  494.  
  495.     (LET ((X (GIVE-ITEM)) (Y (GIVE-LIST)))
  496.        (MEMBER X Y :TEST #'EQ))
  497.  
  498. which the optimizer may then replace effectively with
  499.  
  500.     (MEMBER (GIVE-ITEM) (GIVE-LIST) :TEST #'EQ)
  501.  
  502. or
  503.  
  504.     (DO ((X (GIVE-ITEM))
  505.          (Y (GIVE-LIST) (CDR Y)))
  506.         ((ENDP Y) NIL)
  507.       (WHEN (EQ X (CAR Y)) (RETURN Y)))
  508.  
  509. depending on the compilation mode.
  510.  
  511. -----------------------
  512. Date: 
  513. By: 
  514. Subject: 
  515. -----------------------
  516.